package me.zhengjie.modules.insurance.pojo;

import java.util.Arrays;
import java.util.Objects;

/**
 * 案件进度
 *
 * @author hehui
 * @date 2022/01/05
 */
public enum CaseSpeek {
    WAIT_PERFECT(-1,"客服待处理"),
    ABNORMAL(0,"异常"),
    COLLECT_MATERIAL(1,"收集材料"),
    AUDIT_MATERIAL(2,"审核材料"),
    WAIT_FEE(3,"待定损"),
    WAIT_REMIT(4,"待保险公司打款"),
    WAIT_SEAL(5,"待盖章/邮寄"),
    OVER(6,"结案"),
    ;

    private final int code;
    private final String desc;

    CaseSpeek(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }


    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static CaseSpeek codeOf(int code) {
        return Arrays.stream(values()).filter(v -> Objects.equals(code, v.getCode())).findFirst().get();
    }
}
